﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>solcoo 商户明细统计</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    	<meta http-equiv="pragma" content="no-cache" />
    	<meta http-equiv="cache-control" content="no-cache" />
    	<meta http-equiv="expires" content="0" />
    	<meta http-equiv="keywords" content="keyword1, keyword2, keyword3" />
    	<meta http-equiv="description" content="solcoo 商户明细统计" />
    	<!-- css -->
    	<link type="text/css" rel="stylesheet" href="css/data.css" />
    	<!-- js -->
    	<script type="text/javascript" src="js/jquery-1.9.1.js" charset="UTF-8"></script>
    	<script type="text/javascript">
   			function reportPic(picName) {
   				$('#pic').empty().append('<img src="static/pic/report/data/' + picName + '" />');
   			}
   		</script>
	</head>
	<body>
		<c:if test="${empty sessionScope.admin}">
			<jsp:forward page="/" />
		</c:if>
		<div id="outter">
			<div id="nav">
				<a href="data.jspDo">Solcoo 数据统计</a>&nbsp;&nbsp;
				<a href="shanghuData.jspDo">商户数据统计</a>&nbsp;&nbsp;
				<a href="javascript:void(0);"><span class="redTab">商户明细统计</span></a>
			</div>
			<!-- 数据 -->
			<div id="data">
				<form method="post" action="<%=request.getContextPath() %>/shanghumxData.jspDo">
					<label for="yonghum">商户名称: </label>
					<select id="yonghum" name="yonghum"></select>
					<input type="submit" class="btn" value="查询" />
				</form>
				<table>
					<caption> ${curYear} 商户明细数据统计 <span class="red">${shanghumc}</span></caption>
					<tr>
						<td></td>
						<th>01月</th>
						<th>02月</th>
						<th>03月</th>
						<th>04月</th>
						<th>05月</th>
						<th>06月</th>
						<th>07月</th>
						<th>08月</th>
						<th>09月</th>
						<th>10月</th>
						<th>11月</th>
						<th>12月</th>
						<td></td>
					</tr>
					<tr class="tr1">
						<td class="label">成交量（实收款）</td>
						<c:forEach var="sskByShanghu" items="${ssksByShanghu}">
							<td><fmt:formatNumber value="${sskByShanghu}" pattern="0.0"/></td>
						</c:forEach>
						<td>
							<a href="javascript:void(0);" onclick="reportPic('实收款折线图.jpg');">折线图</a>
						</td>
					</tr>
					<tr class="tr0">
						<td class="label">会员总数量</td>
						<c:forEach var="vipCountByShanghu" items="${vipCountsByShanghu}">
							<td>${vipCountByShanghu}</td>
						</c:forEach>
						<td>
							<a href="javascript:void(0);" onclick="reportPic('会员数折线图.jpg');">折线图</a>
						</td>
					</tr>
					<tr class="tr1">
						<td class="label">交易笔数</td>
						<c:forEach var="businessCountByShanghu" items="${businessCountsByShanghu}">
							<td>${businessCountByShanghu}</td>
						</c:forEach>
						<td>
							<a href="javascript:void(0);" onclick="reportPic('交易笔数折线图.jpg');">折线图</a>
						</td>
					</tr>
					<tr class="tr0">
						<td class="label">发短信条数</td>
						<c:forEach var="messageCountByShanghu" items="${messageCountsByShanghu}">
							<td>${messageCountByShanghu}</td>
						</c:forEach>
						<td>
							<a href="javascript:void(0);" onclick="reportPic('发短信条数折线图.jpg');">折线图</a>
						</td>
					</tr>
					<tr class="tr1">
						<td class="label">新增会员数量</td>
						<c:forEach var="addVipByShanghu" items="${addVipsByShanghu}">
							<td>${addVipByShanghu}</td>
						</c:forEach>
						<td>
							<a href="javascript:void(0);" onclick="reportPic('商户月新增会员数量折线图.jpg');">折线图</a>
						</td>
					</tr>
				</table>
			</div>
			<div id="pic"></div>
		</div>
	</body>
	<script type="text/javascript">
		$(function() {
			//----- 商户查询字段初始化 -----
			$.ajax({
	            type: "POST",
	            url: "shanghumc.jspDo",
	            data: {},
	            async: false,
	            cache: false,
	            complete: function() {},
	            success: function(msg) {
	            	var shanghu;
	            	var options = '<option value="" selected="selected"></option>';
	            	for (var i = 0; i < msg.length; i++) {
	            		shanghu = msg[i];
	            		
	            		options += '<option value="'+ shanghu.id +'">'+ shanghu.shanghumc +'</option>';
	            	}
	            	
	                $('#yonghum').empty().append(options);
	            },
	            error: function() { alert("系统异常, 请重试！"); }
	        });
        });
	</script>
</html>